<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<div class="grid_3 div-label">Código</div>
	<div class="grid_6 div-campo">
		<p:inputText value="#{provaBean.provaInstance.codigo}" disabled="true" styleClass="width_5" />
	</div>
	
	<div class="grid_2 div-label">Professor</div>
	<div class="grid_7 div-campo">
		<p:inputText value="#{provaBean.provaInstance.professor.nomeCompleto}" disabled="true" styleClass="width_7" />
	</div>
	
	<div class="grid_3 div-label">Aplicada Em</div>
	<div class="grid_6 div-campo">
		<p:inputText value="#{provaBean.provaInstance.aplicadaEm.ano}" styleClass="width_4" readonly="true">
			<f:convertDateTime pattern="yyyy" />
		</p:inputText>
		<p:commandButton type="button" image="ui-icon ui-icon-search" 
			onclick="promptBuscaOfertaDisciplina.show();" style="margin-left:10px;"/>
	</div>
	
	<div class="grid_2 div-label">Valor</div>
	<div class="grid_3 div-campo">
		<p:inputText value="#{provaBean.provaInstance.valor}" styleClass="width_2" disabled="true" />
	</div>
	<div class="grid_2 div-label">Peso</div>
	<div class="grid_2 div-campo">
		<p:inputText value="#{provaBean.provaInstance.peso}" styleClass="width_2" disabled="true" />
	</div>
	
	<div class="clear"></div>
	
	<div class="grid_3 div-label">Data Início</div>
	<div class="grid_6 div-campo">
		<p:calendar value="#{provaBean.provaInstance.dataHoraInicio}" readOnlyInputText="true" yearRange="c:c+10" 
			pattern="MM/dd/yyyy" inputStyleClass="width_5" navigator="true"/>
	</div>
	
	<div class="grid_2 div-label">Término</div>
	<div class="grid_7 div-campo">
		<p:calendar value="#{provaBean.provaInstance.dataHoraFim}" readOnlyInputText="true" yearRange="c:c+10"
			pattern="dd/MM/yyyy" inputStyleClass="width_7" navigator="true" />
	</div>
	
	<div class="clear"></div>
	
	<div class="grid_3 div-label">Descrição</div>
	<div class="grid_15 div-label">
		<p:editor value="#{provaBean.provaInstance.descricao}" autoResize="false" 
			rows="4" width="586" styleClass="width_15"  />
	</div>
	
	<div class="grid_9 subtitulo">Questões</div>
	<div class="grid_8 right" style="width: 350px;">
		<br/>
		<p:commandButton value="Criar" action="#{provaBean.goCreateQuestaoBase}" 
			oncomplete="dialogoCreateQuestao.show()" update=":formCreateQuestao" style="margin-left:4px"/>
		<p:commandButton type="button" value="Adicionar" onclick="dialogoBuscaQuestaoBase.show()" style="margin-left:4px"/>
		<p:commandButton value="Remover" action="#{provaBean.goDeleteQuestao}" style="margin-left:4px"
			oncomplete="dialogoDeleteQuestao.show()" update=":formDeleteQuestao"/>
	</div>
	<div class="grid_18">
		<p:dataTable widgetVar="dataTableQuestoes" 
			id="dataTableQuestoes" 
			paginator="true" paginatorPosition="bottom"
			value="#{provaBean.provaInstance.questoes}" var="var"
			emptyMessage="Nenhum registro encontrado!" 
			rows="10" dynamic="true">
			<p:column headerText="Código">
	            <h:outputText value="#{var.codigo}" />  
	        </p:column>
	        <p:column headerText="Cabeçalho">
	        	<h:outputText value="#{var.cabecalho}" />
	        </p:column> 
		</p:dataTable>
	</div>
</f:view>